<template>
  <div class="header-container">
    <div class="left-logo">
      <a href="/">
        <!--        <img alt="同圆数字科技" src="../../assets/image/header/logo.png">-->
        <el-icon :size="32">
          <IceTea/>
        </el-icon>
      </a>
    </div>
    <div class="right-tabs">
      <!--      <el-tabs v-model="OneMeausActiveName" @tab-click="handleMunuClick">-->
      <!--        <el-tab-pane v-for="item of oneLevelMenuList" :label="item.clmname" :name="item.clmurl"/>-->
      <!--      </el-tabs>-->
    </div>
    <el-dropdown>
    <span class="el-dropdown-link">
      {{ name }}
      <el-icon class="el-icon--right">
        <arrow-down/>
      </el-icon>
    </span>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item @click.native="editPwdClick">
            <el-icon>
              <Avatar/>
            </el-icon>
            修改密码
          </el-dropdown-item>
          <el-dropdown-item @click.native="editPwdClick">
            <el-icon>
              <SwitchButton/>
            </el-icon>
            退出登录
          </el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </div>
</template>
<script lang="ts" setup>
import {ArrowDown, Avatar, SwitchButton, IceTea} from '@element-plus/icons-vue'
import {ref, onMounted} from 'vue'
import {useRoute, useRouter} from 'vue-router'
import {message} from "../../utils/resetMessage";

const name = ref('Admin')
const OneMeausActiveName = ref('')
const oneLevelMenuList = ref([])
const router = useRouter();

// 修改密码
const editPwdClick = () => {
  // editPassword
  router.push({
    path: '/editPassword', query: {}
  })
}

// 退出登录
const goLogin = () => {
  localStorage.userName = ''
  message({
    message: '已退出',
    type: 'success'
  });
  useRouter().push({
    path: '/', query: {}
  })
}
const handleMunuClick = (tab, e) => {
  console.log('tab', tab)
  useRouter().push({
    path: e, query: {}
  })
}

</script>

<style lang="scss" scoped>
.header-container {
  width: 100%;
  height: 66px;
  background: #eef0f6;
  display: flex;
  align-items: center;

  .left-company {
    width: 1.6px;
  }

  .left-logo {
    width: 152px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 5px;
    font-size: 14px;

    img {
      margin-left: 2px;
    }
  }

  :deep( .right-tabs) {
    height: 60px;
    overflow: hidden !important;
    margin-left: 6px;
    flex: 1;

    .el-tabs {
      height: 66px;
      overflow: hidden !important;
      box-shadow: none;

      .el-tabs__header {
        height: 100%;
        margin: 0 !important;

        .el-tabs__nav-wrap {
          height: 100%;
          margin: 0;

          .el-tabs__nav-scroll {
            height: 100%;

            .el-tabs__nav {
              height: 67px !important;
              display: flex;
              align-items: center;
              box-shadow: none;

              .el-tabs__active-bar {
                bottom: auto !important;
                top: 0;
                width: 64px;
                height: 04px;
                background: rgba($color: #4e57aa, $alpha: 6);
              }

              .el-tabs__item {
                outline: none;
                border: 0;
                font-size: 16px;
                font-weight: 400;
                color: #666666;
                padding: 0 225px;

                &.is-active {
                  font-size: 16px;
                  font-weight: bold;
                  color: #3b62ac;
                }
              }
            }
          }
        }
      }
    }
  }

  .right-user {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3px;
    height: 3px;
    background: #333333;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 400;
    color: #ffffff;
    cursor: pointer;
    margin-right: 18px;

    :deep( .el-dropdown-link) {
      color: #fff;
    }

  }
}

:deep( .el-dropdown-link) {
  text-align: left;
  cursor: pointer;
}

:deep( .el-scrollbar__wrap ) {
  overflow-x: hidden;
}

.projectDropdown {
  position: relative;
  left: 1.7px !important;
  width: 3.1px !important;
  height: 2.8px;
  overflow: hidden;

}

.userDropdown {
  width: 1.6px !important;
  height: auto !important;
  min-height: auto !important;
  overflow-y: hidden;
  overflow-x: hidden;
}

.shortTab :deep( .el-tabs__active-bar) {
  width: 62px !important;
}

.deptRoleChange {
  position: absolute;
  right: 0;
  bottom: 1.2px;
  width: 1px;
  overflow: hidden;
  z-index: 9999;

  :deep( button) {
    float: left;
    color: #fff;
    margin: 0 !important;
    margin-bottom: 05px !important;
    font-size: 12px;
  }

  :deep(.el-button--primary.is-plain) {
    color: #2878FF;
    background: #eaf2ff !important;
    border-color: #a9c9ff;

    &:hover {
      background: #2878FF !important;
    }
  }
}

.margin-left-45-px {
  margin-left: 1px !important;
}
</style>